home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / pdatb503.zip / DEMON.BAS next >
BASIC Source File  |  1991-07-11  |  73KB  |  1,775 lines

  1. ' DEMON.BAS     this program illustrates some of the ways that the routines
  2. '               provided in the Libraries in this package, can enhance your
  3. '               Extended QuickBASIC programs.
  4. '
  5. '   Author:     Christy Gemmell
  6. '   For:        Assembly-Language Toolbox for QuickBASIC
  7. '   Version:    5.20
  8. '   Date:       25/5/1991
  9. '
  10. '   For MicroSoft QuickBASIC and BASIC 7 Professional Development System.
  11. '   Assembler routines created with MicroSoft Macro Assembler MASM 5.1
  12. '
  13. '   Compile:    BC /E/Fs/O/S/X demon;
  14. '   Link:       Link /E/F demon,,,toolbox.lib mixed.lib;
  15. '
  16. '   $DYNAMIC                             ' required for stringsort routine
  17. '
  18. '┌────────────────────────────────────────────────────────────────────────┐
  19. '│      External Functions and Procedures.                                │
  20. '└────────────────────────────────────────────────────────────────────────┘
  21. '
  22. '   The following prototypes refer to assembly-language procedures which
  23. '   are in the library files MIXED.LIB and MIXED.QLB. One or other of these
  24. '   libraries must be linked to the program which calls them.
  25. '
  26.     DECLARE FUNCTION Attribute% (BYVAL Fore%, BYVAL Back%)
  27.     DECLARE FUNCTION CapsLock% (BYVAL Switch%)
  28.     DECLARE FUNCTION Cpu% ()
  29.     DECLARE FUNCTION EmsError% ()
  30.     DECLARE FUNCTION EmsFrame% ()
  31.     DECLARE FUNCTION EmsOwned% (BYVAL Handle%)
  32.     DECLARE FUNCTION EmsPages% (BYVAL Switch%)
  33.     DECLARE FUNCTION EmsPresent% ()
  34.     DECLARE FUNCTION EmsVersion% ()
  35.     DECLARE FUNCTION FarPeek% (BYVAL Segment&, BYVAL OffSet&)
  36.     DECLARE FUNCTION KeyFlags% ()
  37.     DECLARE FUNCTION KeyIn% ()
  38.     DECLARE FUNCTION MathsChip% ()
  39.     DECLARE FUNCTION MouseInit% ()
  40.     DECLARE FUNCTION NumLock% (BYVAL Switch%)
  41.     DECLARE FUNCTION PeekWord& (BYVAL Segment&, BYVAL OffSet&)
  42.     DECLARE FUNCTION PrinTest% (BYVAL Printer%)
  43.     DECLARE FUNCTION Rand% (BYVAL Lower%, BYVAL Higher%)
  44.     DECLARE FUNCTION ScrLock% (BYVAL Switch%)
  45.     DECLARE FUNCTION SizeOf& (FileSpec$)
  46.     DECLARE FUNCTION StatusLine% (Message$)
  47.     DECLARE FUNCTION StringScan% (Trgt$, BYVAL Size%, BYVAL Strt%, BYVAL Addr%)
  48.     DECLARE FUNCTION Verify% (BYVAL Default%, BYVAL Row%, Prompt$,_
  49.                               BYVAL Attr%, BYVAL Mouse%)
  50.     DECLARE SUB BackFill (BYVAL Row%, BYVAL Col%, BYVAL Rows%, BYVAL Cols%,_
  51.                           BYVAL Attr%)
  52.     DECLARE SUB Cipher (Text$, KeyWord$)
  53.     DECLARE SUB ClearEnd (BYVAL Switch%, BYVAL Attr%)
  54.     DECLARE SUB Curtains (BYVAL Speed%, BYVAL Attr%)
  55.     DECLARE SUB EmsGet (BYVAL Segment%, BYVAL OffSet%, BYVAL Length%,_
  56.                         BYVAL Page%, BYVAL Handle%, Done%)
  57.     DECLARE SUB EmsPut (BYVAL Segment%, BYVAL OffSet%, BYVAL Length%,_
  58.                         BYVAL Page%, BYVAL Handle%, Done%)
  59.     DECLARE SUB EmsRelease (BYVAL Handle%)
  60.     DECLARE SUB EmsRequest (BYVAL Pages%, Handle%)
  61.     DECLARE SUB FastPrint (BYVAL Row%, BYVAL Col%, Message$, BYVAL Attr%)
  62.     DECLARE SUB KeyFlush ()
  63.     DECLARE SUB MisTake (BYVAL Row%, Message$, BYVAL Attr%, BYVAL Mouse%)
  64.     DECLARE SUB MouseHide ()
  65.     DECLARE SUB MouseNow (leftButton%, rightButton%, xMouse%, yMouse%)
  66.     DECLARE SUB MouseShow ()
  67.     DECLARE SUB Pause (BYVAL Ticks%)
  68.     DECLARE SUB PopUp (BYVAL Row%, BYVAL Col%, BYVAL Hght%, BYVAL Wdth%,_
  69.                        BYVAL Attr%, BYVAL Brdr%, BYVAL Shdw%, BYVAL Zoom%)
  70.     DECLARE SUB PrintSet (BYVAL Row%, BYVAL Col%, BYVAL Attr%,_
  71.                           BYVAL Printer%, BYVAL Mouse%)
  72.     DECLARE SUB ReSeed (BYVAL Seed&)
  73.     DECLARE SUB Scroll (BYVAL Dir%, BYVAL Y1%, BYVAL X1%, BYVAL Y2%,_
  74.                         BYVAL X2%, BYVAL Units%, BYVAL Attr%)
  75.     DECLARE SUB ShutUp (BYVAL Speed%)
  76.     DECLARE SUB StringSort (BYVAL Dir%, BYVAL Size%, BYVAL Addr%)
  77.  
  78. '   These are native QuickBASIC procedures which are also in MIXED.LIB/QLB
  79. '
  80.     DECLARE FUNCTION BinDec& (Binary$)
  81.     DECLARE FUNCTION BitTest% (Number%, Bit%)
  82.     DECLARE FUNCTION DateInput$ (Default$, Context%, Topic$, HotKey%)
  83.     DECLARE FUNCTION DosVersion$ ()
  84.     DECLARE FUNCTION FindFile$ (FileSpec$)
  85.     DECLARE FUNCTION GetFlag% (Flag%)
  86.     DECLARE FUNCTION IsDir% (Test$)
  87.     DECLARE FUNCTION LongDate$ (Day%, Month%, Year%)
  88.     DECLARE FUNCTION RevInput$ (Max%, Default$, Ctx%, Topic$, Mask%, HotKey%)
  89.     DECLARE SUB BarMenu (P1%, P2%, P3%, Menu$(), P5%, P6%, P7%, P8$, Mouse%)
  90.     DECLARE SUB CheckPrinter (Printer%)
  91.     DECLARE SUB Panel (Row%, Col%, Rows%, Cols%, Border%, Attr%)
  92.     DECLARE SUB SetFlag (Flag%, Setting%)
  93.     DECLARE SUB SortFile (PathName$, OffSet%, FieldLen%, RecordLen%, Done%)
  94.     DECLARE SUB VerMenu (P1%, P2%, P3%, P4%, P5%, P6$, Menu$(),_
  95.                          P8%, P9%, P10%, P11%, P12$, Mouse%)
  96.     DECLARE SUB VideoMode (Colour%, MaxRes%, VideoRam%)
  97.  
  98. '   Local, program-specific, functions and procedures.
  99. '
  100.     DECLARE SUB Frame (Title$, Switch%)
  101.  
  102. '┌────────────────────────────────────────────────────────────────────────┐
  103. '│      Initialisation.                                                   │
  104. '└────────────────────────────────────────────────────────────────────────┘
  105. '
  106.     CONST FALSE = 0, TRUE = NOT FALSE
  107.  
  108. '   Allow plenty of stack space for function and procedure calls.
  109. '
  110.     CLEAR , , &H2000
  111.  
  112. '   Establish error trapping and point to error handler.
  113. '
  114.     ON ERROR GOTO Trap
  115.  
  116. '   Check video capabilities of the host system (default to MDA).
  117. '
  118.     Colour% = FALSE                             ' Default to monochrome
  119.     MaxRes% = 0                                 ' Default to text only
  120.     VideoRam% = 4                               ' Default to 4K buffer
  121.  
  122.     VideoMode Colour%, MaxRes%, VideoRam%       ' Find what's installed
  123.  
  124. '   Set display colours for colour and monochrome displays.
  125. '
  126.     IF Colour% THEN
  127.        BarColour% = 48                          ' Black on Cyan
  128.        HeadColour% = 31                         ' Bright White on Blue
  129.        StatColour% = 48                         ' Black on Cyan
  130.        TextColour% = 112                        ' Black on White
  131.     ELSE
  132.        BarColour% = 112                         ' Reverse video
  133.        HeadColour% = 15                         ' Intense White on Black
  134.        StatColour% = 112                        ' Reverse video
  135.        TextColour% = 7                          ' White on Black
  136.     END IF
  137.  
  138. '   Check the type of display adaptor installed.
  139. '
  140.     SELECT CASE MaxRes%
  141.         CASE 13
  142.              IF VideoRam% = 64 THEN
  143.                 Adaptor$ = "Multi-Colour Graphics Array"
  144.              ELSE
  145.                 Adaptor$ = "Video Graphics Array"
  146.              END IF
  147.         CASE 7 TO 10
  148.              Adaptor$ = "Enhanced Graphics Adaptor"
  149.         CASE 3
  150.              Adaptor$ = "Hercules Graphics Card"
  151.         CASE 2
  152.              Adaptor$ = "Colour Graphics Adaptor"
  153.         CASE ELSE
  154.              Adaptor$ = "Monochrome Display Adaptor"
  155.     END SELECT
  156.  
  157.     Mouse% = MouseInit%                         ' See if a mouse is available
  158.  
  159.     DIM Menu$(0 TO 12)                          ' Dimension array for menus
  160.     Printer% = 1                                ' Use the first parallel port
  161.     RootName$ = "DEMON"                         ' Used for help topic files
  162.     DOS$ = "DOS " + DosVersion$                 ' Check current DOS version
  163.  
  164.     DY$ = MID$(DATE$, 4, 2): DY% = VAL(DY$)     ' What day is this?
  165.     MO$ = LEFT$(DATE$, 2): MO% = VAL(MO$)       ' What month is this?
  166.     YR$ = RIGHT$(DATE$, 2): YR% = VAL(YR$)      ' What year is this?
  167.     Now$ = DY$ + "/" + MO$ + "/" + YR$          ' Format it as DD/MM/YY
  168.  
  169.     ToDay$ = LongDate$(DY%, MO%, YR%)           ' Translate date into words
  170.  
  171. '┌────────────────────────────────────────────────────────────────────────┐
  172. '│      Main Menu.                                                        │
  173. '└────────────────────────────────────────────────────────────────────────┘
  174. '
  175.     ReSeed TIMER
  176. D001:
  177.     Head$ = "ASSEMBLY-LANGUAGE TOOLBOX FOR QuickBASIC"
  178.     LOCATE , , 0: Frame Head$, 1: Bar% = 1
  179. D002:
  180.     Menu$(0) = "WSFKMEX": Menu$(1) = "Windows"
  181.     Menu$(2) = "Screen": Menu$(3) = "Files"
  182.     Menu$(4) = "Keyboard": Menu$(5) = "Memory"
  183.     Menu$(6) = "Examples": Menu$(7) = "eXit"
  184.     Abort% = FALSE: HotKey% = FALSE
  185.     IF Nxt% THEN
  186.        IF Bar% = 1 THEN Bar% = 7
  187.        IF Bar% = 8 THEN Bar% = 2
  188.     END IF
  189.     BarMenu 3, BarColour%, 7, Menu$(), Bar%, Nxt%, 1, RootName$, Mouse%
  190.     SELECT CASE Bar%
  191.         CASE 1
  192.              GOTO D100
  193.         CASE 2
  194.              GOTO D200
  195.         CASE 3
  196.              GOTO D300
  197.         CASE 4
  198.              GOTO D400
  199.         CASE 5
  200.              GOTO D500
  201.         CASE 6
  202.              GOTO D600
  203.         CASE 7
  204.              GOTO D700
  205.         CASE ELSE
  206.              Ok% = Verify%(1, 9, "Exit program, are you sure", 0, Mouse%)
  207.              IF Ok% THEN GOTO Egress
  208.     END SELECT
  209. GOTO D002
  210.  
  211. '┌────────────────────────────────────────────────────────────────────────┐
  212. '│      Popup Window Demonstration.                                       │
  213. '└────────────────────────────────────────────────────────────────────────┘
  214. '
  215. D100:
  216.     A$ = STRING$(1680, "░"): FastPrint 4, 1, A$, 30
  217.     FastPrint 25, 1, SPACE$(80), StatColour%: A$ = ""
  218.     FastPrint 25, 2, Adaptor$, StatColour%
  219.     FastPrint 25, 71, DOS$, StatColour%
  220.     FOR M% = 1 TO 3
  221.         Area% = 0: O% = 0: B% = 1
  222.         DO
  223.             H% = Rand%(5, 10): W% = Rand%(14, 40)
  224.             Area% = Area% + (H% + 1) * (W% + 1)
  225.             IF Area% > 7200 THEN EXIT DO
  226.             K% = Rand%(4, 24 - H%): J% = Rand%(1, 79 - W%)
  227.             R% = Rand%(1, 4): S% = Rand%(1, 4)
  228.             Attrib% = Attribute%(15, B%)
  229.             PopUp K%, J%, H%, W%, Attrib%, R%, S%, -1
  230.             FastPrint K%, J% + ((W% \ 2) - 5), "[ WINDOW ]", Attrib%
  231.             O% = O% + 1: B% = B% + 1: IF B% > 6 THEN B% = 1
  232.          LOOP UNTIL O% = 30
  233.          IF (M% = 3) THEN SLEEP 3 ELSE SLEEP 1
  234.          FOR I% = O% TO 1 STEP -1
  235.              ShutUp -1
  236.          NEXT I%
  237.     NEXT M%
  238.     PopUp 4, 15, 10, 30, 52, 4, 1, -1: PopUp 3, 36, 13, 40, 47, 3, 1, -1
  239.     PopUp 9, 10, 13, 40, 31, 2, 1, -1: PopUp 12, 42, 11, 36, 67, 1, 1, -1
  240.     PopUp 2, 31, 5, 20, 78, 2, 1, -1: FastPrint 4, 34, "Presenting ...", 78
  241.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 7)
  242.     PopUp 8, 20, 7, 40, Attrib%, 2, 1, -1
  243.     FastPrint 8, 31, "[ QUICK  WINDOWS ]", Attrib%
  244.     FastPrint 10, 29, "Windowing Routines for", Attrib%
  245.     FastPrint 11, 30, "Microsoft QuickBASIC", Attrib%
  246.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 3)
  247.     PopUp 17, 55, 7, 24, Attrib%, 1, 3, -1
  248.     FastPrint 19, 66, "By", Attrib%
  249.     FastPrint 20, 59, "Christy  Gemmell", Attrib%
  250.     FastPrint 21, 57, "with acknowledgement", Attrib%
  251.     FastPrint 22, 58, "to Rick Fothergill", Attrib%
  252.     SLEEP 3: KeyFlush: Attrib% = Attribute%(14, 1)
  253.     PopUp 13, 2, 10, 23, Attrib%, 2, 4, 0
  254.     FastPrint 15, 4, "A Library of screen", Attrib%
  255.     FastPrint 16, 4, "handling procedures", Attrib%
  256.     FastPrint 17, 4, "and functions which", Attrib%
  257.     FastPrint 18, 4, "can be incorporated", Attrib%
  258.     FastPrint 19, 4, "in your QuickBASIC", Attrib%
  259.     FastPrint 20, 9, "programs.", Attrib%
  260.     SLEEP 4: KeyFlush: Attrib% = Attribute%(15, 1)
  261.     PopUp 16, 27, 5, 26, Attrib%, 2, 1, 0
  262.     FastPrint 18, 30, "HOLD ONTO YOUR HATS", Attrib%
  263.     SLEEP 2: KeyFlush: FOR I% = 1 TO 9: ShutUp -1: NEXT
  264.     Attrib% = 112: PopUp 9, 16, 8, 50, Attrib%, 2, 2, 0: RESTORE Blurb
  265.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, Attrib%: NEXT
  266.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, Attrib%
  267.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, Attrib%: NEXT
  268.     SLEEP 5: KeyFlush: IF Colour% THEN Attrib% = Attribute%(1, 2)
  269.     PopUp 5, 5, 6, 35, Attrib%, 0, 1, -1
  270.     SLEEP 3: ShutUp -1: Scroll 1, 10, 17, 15, 64, 0, 112
  271.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  272.     SLEEP 6: KeyFlush: IF Colour% THEN Attrib% = Attribute%(15, 6)
  273.     PopUp 6, 5, 8, 35, Attrib%, 0, 2, -1
  274.     FastPrint 6, 15, "[  No  Frame  ]", Attrib%
  275.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(11, 1)
  276.     PopUp 7, 8, 8, 35, Attrib%, 1, 2, -1
  277.     FastPrint 7, 17, "[ Frame Style 1 ]", Attrib%
  278.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(0, 2)
  279.     PopUp 8, 11, 8, 35, Attrib%, 2, 2, -1
  280.     FastPrint 8, 20, "[ Frame Style 2 ]", Attrib%
  281.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(0, 3)
  282.     PopUp 9, 14, 8, 35, Attrib%, 3, 2, -1
  283.     FastPrint 9, 23, "[ Frame Style 3 ]", Attrib%
  284.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(14, 4)
  285.     PopUp 10, 17, 8, 35, Attrib%, 4, 2, -1
  286.     FastPrint 10, 26, "[ Frame Style 4 ]", Attrib%
  287.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(12, 5)
  288.     PopUp 11, 20, 8, 35, Attrib%, 5, 2, -1
  289.     FastPrint 11, 29, "[ Frame Style 5 ]", Attrib%
  290.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(13, 6)
  291.     PopUp 12, 23, 8, 35, Attrib%, 6, 2, -1
  292.     FastPrint 12, 32, "[ Frame Style 6 ]", Attrib%
  293.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(15, 2)
  294.     PopUp 13, 26, 8, 35, Attrib%, 7, 2, -1
  295.     FastPrint 13, 35, "[ Frame Style 7 ]", Attrib%
  296.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(1, 3)
  297.     PopUp 14, 29, 8, 35, Attrib%, 8, 2, -1
  298.     FastPrint 14, 39, "[ Frame Style 8 ]", Attrib%
  299.     SLEEP 4: KeyFlush: FOR I% = 1 TO 9: ShutUp -1: NEXT
  300.     Scroll 1, 10, 17, 15, 64, 0, 112
  301.     FOR I% = 11 TO 13: READ Me$: FastPrint I%, 20, Me$, 112: NEXT
  302.     SLEEP 6: KeyFlush
  303.     FOR I% = 1 TO 15
  304.         Label$ = "[ Colour:" + STR$(I%) + " ]"
  305.         J% = Rand%(1, 51): K% = Rand%(1, 13)
  306.         Attrib% = Attribute%(I%, 0)
  307.         PopUp K% + 1, J% + 1, 7, 24, Attrib%, 4, 0, 0
  308.         FastPrint K% + 1, J% + 6, Label$, Attrib%
  309.         SLEEP 1: KeyFlush
  310.     NEXT I%
  311.     Attrib% = Attribute%(31, B%)
  312.     PopUp 7, 20, 7, 24, Attrib%, 4, 2, 0
  313.     FastPrint 7, 25, "[ Colour: 31 ]", Attrib%
  314.     SLEEP 4: KeyFlush: FOR I% = 1 TO 16: ShutUp 0: NEXT
  315.     Scroll 1, 10, 17, 15, 64, 0, 112
  316.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  317.     SLEEP 6: KeyFlush: Attrib% = Attribute%(15, 1)
  318.     PopUp 2, 2, 11, 30, Attrib%, 7, 0, 0
  319.     SLEEP 3: KeyFlush: ShutUp 0: Scroll 1, 10, 17, 15, 64, 0, 112
  320.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  321.     SLEEP 6: KeyFlush: Attrib% = Attribute%(14, 5)
  322.     PopUp 5, 5, 10, 30, Attrib%, 2, 1, 0
  323.     FastPrint 9, 14, "Left Shadow", Attrib%
  324.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 2)
  325.     PopUp 5, 45, 10, 30, Attrib%, 2, 2, 0
  326.     FastPrint 9, 54, "Right Shadow", Attrib%
  327.     SLEEP 2: KeyFlush: ShutUp 0: ShutUp 0
  328.     Scroll 1, 10, 17, 15, 64, 0, 112
  329.     FastPrint 12, 31, "Windows can be zoomed", 112
  330.     FastPrint 13, 33, "onto the screen.", 112
  331.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 2)
  332.     PopUp 2, 2, 15, 60, Attrib%, 2, 0, -1
  333.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 3)
  334.     PopUp 13, 10, 10, 60, Attrib%, 3, 0, -1
  335.     SLEEP 2: KeyFlush: Attrib% = Attribute%(14, 5)
  336.     PopUp 7, 33, 10, 45, Attrib%, 1, 0, -1
  337.     SLEEP 2: KeyFlush: Attrib% = Attribute%(15, 4)
  338.     IF NOT Colour% THEN Attrib% = 112
  339.     PopUp 7, 10, 12, 63, Attrib%, 2, 1, -1
  340.     FastPrint 12, 32, "<<< W O W >>>", Attrib%
  341.     SLEEP 3: KeyFlush: FOR I% = 1 TO 4: ShutUp -1: NEXT
  342.     Scroll 1, 10, 17, 15, 64, 0, 112
  343.     FOR I% = 10 TO 14: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  344.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  345.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  346.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  347.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  348.     SLEEP 6: KeyFlush: Attrib% = Attribute%(0, 2)
  349.     PopUp 3, 5, 15, 45, Attrib%, 4, 1, -1
  350.     FastPrint 9, 14, "This is the first level ...", Attrib%
  351.     SLEEP 2: KeyFlush: Attrib% = Attribute%(15, 4)
  352.     PopUp 6, 29, 17, 50, Attrib%, 4, 1, -1
  353.     FastPrint 12, 40, "This is the second level ...", Attrib%
  354.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 3)
  355.     PopUp 9, 22, 15, 35, Attrib%, 4, 1, -1
  356.     FastPrint 16, 26, "This is the third level ...", Attrib%
  357.     SLEEP 2: KeyFlush: FastPrint 16, 26, "Now to go back ...         ", Attrib%
  358.     SLEEP 1: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 2
  359.     Scroll 1, 10, 17, 15, 64, 0, 112: KeyFlush
  360.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  361.     Ok% = Verify%(1, 9, "Are you enjoying this program", 0, Mouse%)
  362.     Scroll 1, 10, 17, 15, 64, 0, 112
  363.     IF Ok% THEN
  364.        FastPrint 11, 28, "You sound very positive!", 112
  365.     ELSE
  366.        FastPrint 11, 28, "You sound very negative!", 112
  367.     END IF
  368.     SLEEP 2: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  369.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  370.     SLEEP 3: KeyFlush: SL% = StatusLine%("Want to carry on?")
  371.     IF SL% = 78 OR SL% = 110 OR SL% = 27 THEN
  372.        ShutUp -1
  373.     ELSE
  374.        A$ = STRING$(44, SL%)
  375.        FOR I% = 10 TO 15: FastPrint I%, 19, A$, 112: NEXT
  376.        SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  377.        FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  378.        SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  379.        Ready% = PrinTest%(Printer%)
  380.        IF Ready% THEN
  381.           FastPrint 11, 30, "PRINTER CONTROL MENU", 112
  382.           FastPrint 13, 24, "The Toolbox contains versions for", 112
  383.           FastPrint 14, 27, "two other popular printers.", 112
  384.           FastPrint 25, 2, "Press <ESC> to Abort       ", StatColour%
  385.           PrintSet 4, 51, 0, Printer%, Mouse%
  386.           FastPrint 25, 1, SPACE$(80), StatColour%
  387.           FastPrint 25, 2, Adaptor$, StatColour%
  388.           FastPrint 25, 71, DOS$, StatColour%
  389.           SLEEP 5: KeyFlush
  390.        END IF
  391.        ShutUp -1
  392.        PopUp 4, 15, 10, 30, 52, 4, 1, -1
  393.        PopUp 3, 36, 13, 40, 47, 3, 1, -1
  394.        PopUp 9, 10, 13, 40, 78, 2, 1, -1
  395.        PopUp 12, 42, 11, 36, 67, 1, 1, -1
  396.        PopUp 9, 16, 8, 52, 112, 2, 1, -1
  397.        FastPrint 11, 20, "The video routines in the Toolbox Library", 112
  398.        FastPrint 12, 20, "give you all you need to create powerful", 112
  399.        FastPrint 13, 20, "and professional screen displays in your", 112
  400.        FastPrint 14, 20, "QuickBASIC programs.", 112: SLEEP 9: KeyFlush
  401.        FOR I% = 1 TO 5: ShutUp -1: SLEEP 1: KeyFlush: NEXT
  402.        IF NOT Ready% THEN
  403.           PopUp 10, 18, 5, 44, 96, 1, 2, 0
  404.           Me$ = "Pity you didn't have a printer connected"
  405.           FastPrint 12, 20, Me$, 96: SLEEP 5: KeyFlush: ShutUp 0
  406.        END IF
  407.     END IF
  408. GOTO D001
  409.  
  410. '┌────────────────────────────────────────────────────────────────────────┐
  411. '│      Screen control functions.                                         │
  412. '└────────────────────────────────────────────────────────────────────────┘
  413. '
  414. D200:
  415.     Menu$(0) = "FSCB"
  416.     Menu$(1) = "Fast screen printing"
  417.     Menu$(2) = "Selective scrolling"
  418.     Menu$(3) = "Clear to the end"
  419.     Menu$(4) = "Background colours"
  420.     VerMenu 4, 3, BarColour%, 1, 4, "SCREEN CONTROL", Menu$(),_
  421.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  422.     IF Nxt% THEN GOTO D002
  423.     SELECT CASE Choice%
  424.         CASE 1
  425.              GOTO D210
  426.         CASE 2
  427.              GOTO D220
  428.         CASE 3
  429.              GOTO D230
  430.         CASE 4
  431.              GOTO D240
  432.         CASE ELSE
  433.     END SELECT
  434. GOTO D002
  435.  
  436. '   Screen print demonstration
  437. '
  438. D210:
  439.     A$ = STRING$(1680, "«"): B$ = STRING$(1680, "»")
  440.     FOR I% = 1 TO 255
  441.         FastPrint 4, 1, A$, I%: FastPrint 4, 1, B$, I%
  442.         IF INKEY$ = CHR$(27) THEN EXIT FOR
  443.     NEXT I%
  444.     IF I% = 256 THEN
  445.        A$ = "": B$ = "": C$ = STRING$(1680, "░"): Attrib% = 30
  446.        FastPrint 4, 1, C$, Attrib%: C$ = ""
  447.        IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  448.        PopUp 12, 21, 7, 40, Attrib%, 3, 4, -1
  449.        FastPrint 15, 33, "<<< W O W >>>", Attrib%
  450.        SLEEP 5: KeyFlush: ShutUp -1
  451.     END IF
  452. GOTO D200
  453.  
  454. '   Selective scrolling demonstration
  455. '
  456. D220:
  457.     Panel 4, 1, 21, 80, 1, TextColour%
  458.     IF Colour% THEN BackGround% = 7 ELSE BackGround% = 0
  459.     Clr% = 1: IF Mouse% THEN MouseShow
  460.     DO
  461.        Scroll 0, 4, 21, 7, 60, 1, Attribute%(0, Clr%)
  462.        Scroll 2, 9, 6, 19, 20, 1, Attribute%(0, Clr%)
  463.        Scroll 3, 9, 61, 19, 75, 1, Attribute%(0, Clr%)
  464.        Scroll 1, 21, 21, 24, 60, 1, Attribute%(0, Clr%)
  465.        COLOR Clr%, BackGround%
  466.        LOCATE 19, 25: PRINT "SCROLLING UP";
  467.        Scroll 0, 9, 23, 19, 38, 1, Attribute%(Clr%, BackGround%)
  468.        LOCATE 9, 43: PRINT "SCROLLING DOWN";
  469.        Scroll 1, 9, 41, 19, 58, 1, Attribute%(Clr%, BackGround%)
  470.        Pause 1: Clr% = Clr% + 1
  471.        IF Clr% = BackGround% THEN Clr% = Clr% + 1
  472.        IF Clr% > 7 THEN Clr% = 1
  473.        IF Mouse% THEN
  474.           MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  475.           IF leftButton% THEN
  476.              IF yMouse% > 15 AND yMouse% < 24 THEN
  477.                 Z$ = CHR$(32): EXIT DO
  478.              END IF
  479.           END IF
  480.        END IF
  481.        Z$ = INKEY$
  482.     LOOP UNTIL Z$ = CHR$(27)
  483.     IF Mouse% THEN
  484.        CALL MouseHide: IF Z$ <> CHR$(27) THEN GOTO D002
  485.     END IF
  486. GOTO D200
  487.  
  488. '   Clear to end of line or screen
  489. '
  490. D230:
  491.     Panel 4, 1, 24, 80, 1, TextColour%
  492.     IF Colour% THEN Attrib% = 15 ELSE Attrib% = 112
  493.     FastPrint 22, 30, "Press a key to do it", TextColour%
  494.     FastPrint 10, 3, "Clear end of line >", TextColour%
  495.     LOCATE 10, 22, 1: R$ = INPUT$(1): ClearEnd 0, Attrib%
  496.     FastPrint 15, 3, "Clear end of screen >", TextColour%
  497.     LOCATE 15, 24, 1: R$ = INPUT$(1): ClearEnd 1, Attrib%
  498.     LOCATE , , 0: Frame Head$, 0
  499. GOTO D200
  500.  
  501. D240:
  502.     FastPrint 25, 1, SPACE$(80), StatColour%
  503.     FastPrint 25, 3, "Press any key, <Esc> to abort", StatColour%
  504.     RANDOMIZE TIMER: IF Mouse% THEN MouseShow
  505.     DO
  506.        Row% = Rand%(5, 20): Col% = Rand%(2, 62): Rows% = Rand%(1, 16)
  507.        IF Row% + Rows% > 23 THEN Rows% = 24 - Row%
  508.        Cols% = Rand%(1, 60): IF Col% + Cols% > 78 THEN Cols% = 79 - Col%
  509.        Attrib% = Rand%(0, 255): BackFill Row%, Col%, Rows%, Cols%, Attrib%
  510.        DO
  511.           IF Mouse% THEN
  512.              MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  513.              IF leftButton% THEN
  514.                 IF yMouse% > 15 AND yMouse% < 24 THEN
  515.                    Z$ = CHR$(27)
  516.                    EXIT DO
  517.                 ELSE
  518.                    Z$ = CHR$(32)
  519.                    EXIT DO
  520.                 END IF
  521.              END IF
  522.           END IF
  523.           Z$ = INKEY$
  524.        LOOP UNTIL Z$ <> ""
  525.     LOOP UNTIL Z$ = CHR$(27)
  526.     Frame Head$, 0: IF Mouse% THEN MouseHide:
  527.     IF Z$ <> CHR$(27) THEN GOTO D002
  528. GOTO D200
  529.  
  530. '┌────────────────────────────────────────────────────────────────────────┐
  531. '│      File Functions.                                                   │
  532. '└────────────────────────────────────────────────────────────────────────┘
  533. '
  534. D300:
  535.     Menu$(0) = "WHS"
  536.     Menu$(1) = "Where's that file?"
  537.     Menu$(2) = "How big is that file?"
  538.     Menu$(3) = "Sort that file"
  539.     Abort% = FALSE
  540.     VerMenu 4, 11, BarColour%, 1, 3, "FILE FUNCTIONS", Menu$(),_
  541.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  542.     IF Nxt% THEN GOTO D002
  543.     SELECT CASE Choice%
  544.         CASE 1
  545.              GOTO D310
  546.         CASE 2
  547.              GOTO D320
  548.         CASE 3
  549.              GOTO D330
  550.         CASE ELSE
  551.     END SELECT
  552. GOTO D002
  553.  
  554. '   File Finder
  555. '
  556. D310:
  557.     Panel 4, 1, 21, 80, 1, TextColour%
  558.     RESTORE Finder
  559.     FOR I% = 1 TO 13
  560.         READ Me$: FastPrint 5 + I%, 14, Me$, TextColour%
  561.     NEXT I%
  562.     Scroll 1, 19, 2, 21, 79, 0, TextColour%
  563.     PopUp 19, 19, 4, 44, 96, 2, 2, -1: HotKey% = FALSE
  564.     FastPrint 20, 28, "Enter name of file to find", 96
  565.     LOCATE 21, 21: PathName$ = RevInput$(40, "", 1, "REVINPUT", 0, HotKey%)
  566.     ShutUp -1
  567.     IF HotKey% THEN
  568.        Abort% = TRUE
  569.     ELSE
  570.        PathName$ = RTRIM$(LTRIM$(PathName$))
  571.        Found$ = FindFile$(PathName$)
  572.        IF Found$ <> "" THEN
  573.           Found$ = LTRIM$(RTRIM$(Found$))
  574.           OT% = 40 - (LEN(Found$) \ 2)
  575.           FastPrint 20, OT%, Found$, TextColour%
  576.        END IF
  577.     END IF
  578. GOTO D300
  579.  
  580. D320:
  581.     Panel 4, 1, 21, 80, 1, TextColour%
  582.     RESTORE Size
  583.     FOR I% = 1 TO 12
  584.         READ Me$: FastPrint 5 + I%, 8, Me$, TextColour%
  585.     NEXT I%
  586.     Scroll 1, 18, 3, 23, 78, 0, TextColour%: HotKey% = FALSE
  587.     LOCATE 20, 8: PathName$ = RevInput$(64, "", 1, "REVINPUT", 0, HotKey%)
  588.     IF HotKey% THEN
  589.        Abort% = TRUE
  590.     ELSE   
  591.        PathName$ = LTRIM$(RTRIM$(PathName$))
  592.        IF PathName$ = "" THEN PathName$ = "*.*"
  593.        IF IsDir%(PathName$) THEN PathName$ = PathName$ + "\*.*"
  594.        FastPrint 20, 8, SPACE$(64), TextColour%
  595.        FastPrint 20, 8, PathName$, TextColour%
  596.        Bytes& = SizeOf&(PathName$)
  597.        IF Bytes& > 0 THEN
  598.           Me$ = "Size = " + LTRIM$(RTRIM$(STR$(Bytes&))) + " bytes"
  599.           FastPrint 22, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  600.        ELSE
  601.           MisTake 9, "No match found!", 0, Mouse%
  602.        END IF
  603.     END IF
  604. GOTO D300
  605.  
  606. '   File sorter.
  607. '
  608. D330:
  609.     Panel 4, 1, 21, 80, 1, TextColour%
  610.     RESTORE Sorts
  611.     FOR I% = 1 TO 10
  612.         READ Me$: FastPrint 4 + I%, 8, Me$, TextColour%
  613.     NEXT I%
  614.     IF SizeOf&("SAMPLE.DAT") < 1 THEN
  615.        MisTake 9, "Can't find SAMPLE data file to sort!", 0, Mouse%
  616.     ELSE
  617.        IF Colour% THEN Attrib% = 32 ELSE Attrib% = 112
  618.        PopUp 16, 3, 8, 74, Attrib%, 1, 4, -1
  619.        FastPrint 16, 36, " SAMPLE.DAT ", Attrib%
  620.        OPEN "SAMPLE.DAT" FOR INPUT AS #1
  621.        FOR I% = 1 TO 6
  622.            LINE INPUT #1, A$: OL% = LEN(A$)
  623.            Me$ = LEFT$(A$, OL% - 2)
  624.            FastPrint 16 + I%, 40 - (OL% \ 2) + 1, Me$, Attrib%
  625.        NEXT I%
  626.        CLOSE 1: SL% = StatusLine%("To begin sorting ...")
  627.        SortFile "SAMPLE.DAT", 1, 10, OL% + 2, Done%
  628.        IF Done% THEN
  629.           OPEN "SAMPLE.DAT" FOR INPUT AS #1
  630.           FOR I% = 1 TO 6
  631.               LINE INPUT #1, A$: OL% = LEN(A$)
  632.               Me$ = LEFT$(A$, OL% - 2)
  633.               FastPrint 16 + I%, 40 - (OL% \ 2) + 1, Me$, Attrib%
  634.           NEXT I%
  635.           CLOSE 1
  636.           SL% = StatusLine%("File successfully sorted"): ShutUp -1
  637.        ELSE
  638.           ShutUp -1
  639.           FastPrint 21, 30, "Unable to sort file", TextColour%
  640.        END IF
  641.     END IF
  642. GOTO D300
  643.  
  644. '┌────────────────────────────────────────────────────────────────────────┐
  645. '│      Keyboard functions and procedures.                                │
  646. '└────────────────────────────────────────────────────────────────────────┘
  647. '
  648. D400:
  649.     Menu$(0) = "AKTM"
  650.     Menu$(1) = "ASCII and scan codes"
  651.     Menu$(2) = "Keyboard shift flags"
  652.     Menu$(3) = "Typeahead buffer"
  653.     Menu$(4) = "Mouse position and status"
  654.     VerMenu 4, 19, BarColour%, 1, 4, "KEYBOARD AND MOUSE", Menu$(),_
  655.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  656.     IF Nxt% THEN GOTO D002
  657.     SELECT CASE Choice%
  658.         CASE 1
  659.              GOTO D410
  660.         CASE 2
  661.              GOTO D420
  662.         CASE 3
  663.              GOTO D430
  664.         CASE 4
  665.              GOTO D440
  666.         CASE ELSE
  667.     END SELECT
  668. GOTO D002
  669.  
  670. '   Indexes to the font table in ROM-BIOS, then translates the pixel
  671. '   values of the character specified by a keypress, into a large-
  672. '   scale representation of that character.
  673. '
  674. D410:
  675.     Panel 4, 1, 21, 80, 1, TextColour%
  676.     Fore$ = STRING$(2, "█"): Back$ = STRING$(2, "░")
  677.     FastPrint 6, 31, "┌────────────────┐", TextColour%
  678.     FOR Row% = 7 TO 14
  679.         FastPrint Row%, 31, "│" + STRING$(16, "░") + "│", TextColour%
  680.     NEXT Row%
  681.     FastPrint 15, 31, "└────────────────┘", TextColour%
  682.     FastPrint 25, 1, SPACE$(80), StatColour%
  683.     FastPrint 25, 3, "Press any key, or <Esc> to abort", StatColour%
  684.     LOCATE 21, 40, 1: Abort% = FALSE: CALL KeyFlush
  685.     DO
  686.         Character% = KeyIn%: IF Character% = 27 THEN EXIT DO
  687.         FastPrint 21, 40, " ", TextColour%
  688.         FastPrint 16, 10, SPACE$(60), TextColour%
  689.         SELECT CASE Character%
  690.             CASE 0 TO 127
  691.                  FOR Row% = 1 TO 8
  692.                      Pixel% = FarPeek%(&HF000, &HFA6D + (Character% * 8)_
  693.                                        + Row%)
  694.                      IF Pixel% = 0 THEN
  695.                         FastPrint Row% + 6, 32, STRING$(16, "░"), TextColour%
  696.                      ELSE
  697.                         Col% = 32
  698.                         FOR Column% = 7 TO 0 STEP -1
  699.                             IF Pixel% < 2 ^ Column% THEN
  700.                                FastPrint Row% + 6, Col%, Back$, TextColour%
  701.                             ELSE
  702.                                FastPrint Row% + 6, Col%, Fore$, TextColour%
  703.                                Pixel% = Pixel% - 2 ^ Column%
  704.                             END IF
  705.                             Col% = Col% + 2
  706.                         NEXT Column%
  707.                      END IF
  708.                  NEXT Row%
  709.             CASE ELSE
  710.                  IF Character% < 0 THEN
  711.                     Me$ = SPACE$(16)
  712.                  ELSE
  713.                     Me$ = STRING$(16, Character%)
  714.                  END IF
  715.                  FOR Row% = 1 TO 8
  716.                      FastPrint Row% + 6, 32, Me$, TextColour%
  717.                  NEXT Row%
  718.         END SELECT
  719.         IF Character% < 0 THEN
  720.            Me$ = "Scan Code " + LTRIM$(RTRIM$(STR$(ABS(Character%))))
  721.         ELSE
  722.            Me$ = "ASCII Code " + LTRIM$(RTRIM$(STR$(Character%)))
  723.         END IF
  724.         FastPrint 16, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  725.     LOOP WHILE 1
  726.     LOCATE , , 0: Frame Head$, 0
  727. GOTO D400
  728.  
  729. '   Keyboard shift flags.
  730. '
  731. D420:
  732.     Panel 4, 1, 21, 80, 1, TextColour%
  733.     ShiftFlags% = KeyFlags%: Flag$ = STRING$(16, "0")
  734.     FOR I% = 15 TO 0 STEP -1
  735.         IF BitTest%(ShiftFlags%, I%) THEN
  736.            MID$(Flag$, 16 - I%, 1) = "1"
  737.         END IF
  738.     NEXT I%
  739.     FastPrint 5, 40, "Keyboard Status Word at 0040:0017", TextColour%
  740.     FastPrint 7, 40, "Bit settings (1 = set)", TextColour%
  741.     FastPrint 5, 3, " F E D C B A 9 8 7 6 5 4 3 2 1 0", TextColour%
  742.     FastPrint 6, 3, "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐", TextColour%
  743.     FastPrint 7, 3, "│", TextColour%: Col% = 4
  744.     FOR I% = 1 TO 16
  745.         FastPrint 7, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  746.         Col% = Col% + 2
  747.     NEXT I%
  748.     FastPrint 8, 3, "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘", TextColour%
  749.     FastPrint 9, 3, " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─┴─", TextColour%
  750.     FastPrint 10, 3, " │ │ │ │ │ │ │ │ │ │ │ │ │ └─────", TextColour%
  751.     FastPrint 11, 3, " │ │ │ │ │ │ │ │ │ │ │ │ └───────", TextColour%
  752.     FastPrint 12, 3, " │ │ │ │ │ │ │ │ │ │ │ └─────────", TextColour%
  753.     FastPrint 13, 3, " │ │ │ │ │ │ │ │ │ │ └───────────", TextColour%
  754.     FastPrint 14, 3, " │ │ │ │ │ │ │ │ │ └─────────────", TextColour%
  755.     FastPrint 15, 3, " │ │ │ │ │ │ │ │ └───────────────", TextColour%
  756.     FastPrint 16, 3, " │ │ │ │ │ │ │ └─────────────────", TextColour%
  757.     FastPrint 17, 3, " │ │ │ │ │ │ └───────────────────", TextColour%
  758.     FastPrint 18, 3, " │ │ │ │ │ └─────────────────────", TextColour%
  759.     FastPrint 19, 3, " │ │ │ │ └───────────────────────", TextColour%
  760.     FastPrint 20, 3, " │ │ │ └─────────────────────────", TextColour%
  761.     FastPrint 21, 3, " │ │ └───────────────────────────", TextColour%
  762.     FastPrint 22, 3, " │ └─────────────────────────────", TextColour%
  763.     FastPrint 23, 3, " └───────────────────────────────", TextColour%
  764.     FastPrint 25, 1, SPACE$(80), StatColour%
  765.     FastPrint 25, 3, "Press <Esc> to abort", StatColour%
  766.     RESTORE Shift
  767.     FOR I% = 1 TO 15
  768.         READ Me$: FastPrint I% + 8, 40, Me$, TextColour%
  769.     NEXT I%
  770.     IF Mouse% THEN MouseShow
  771.     DO
  772.         ShiftFlags% = KeyFlags%
  773.         FOR I% = 15 TO 0 STEP -1
  774.             IF BitTest%(ShiftFlags%, I%) THEN
  775.                MID$(Flag$, 16 - I%, 1) = "1"
  776.             ELSE
  777.                MID$(Flag$, 16 - I%, 1) = "0"
  778.             END IF
  779.         NEXT I%
  780.         Col% = 4
  781.         FOR I% = 1 TO 16
  782.             FastPrint 7, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  783.             Col% = Col% + 2
  784.         NEXT I%
  785.         CL% = CapsLock%(2)
  786.         IF CL% THEN
  787.            FastPrint 25, 65, "CAPS", 14
  788.         ELSE
  789.            FastPrint 25, 65, "    ", StatColour%
  790.         END IF
  791.         NL% = NumLock%(2)
  792.         IF NL% THEN
  793.            FastPrint 25, 70, "NUM", 14
  794.         ELSE
  795.            FastPrint 25, 70, "   ", StatColour%
  796.         END IF
  797.         SL% = ScrLock%(2)
  798.         IF SL% THEN
  799.            FastPrint 25, 74, "SCRL", 14
  800.         ELSE
  801.            FastPrint 25, 74, "    ", StatColour%
  802.         END IF
  803.         IF Mouse% THEN
  804.            MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  805.            IF leftButton% THEN
  806.               IF yMouse% > 15 AND yMouse% < 24 THEN
  807.                  Z$ = CHR$(32): EXIT DO
  808.               END IF
  809.            END IF
  810.         END IF
  811.         Z$ = INKEY$
  812.     LOOP UNTIL Z$ = CHR$(27)
  813.     Frame Head$, 0
  814.     IF Mouse% THEN
  815.        CALL MouseHide: IF Z$ <> CHR$(27) THEN GOTO D002
  816.     END IF
  817. GOTO D400
  818.  
  819. '   Keyboard typeahead buffer.
  820. '
  821. D430:
  822.     COLOR 7, 0: Panel 4, 1, 21, 80, 1, 14
  823.     RESTORE KeyBuff: READ Items%
  824.     FOR I% = 1 TO Items%
  825.         READ Row%, Col%, Me$: LOCATE Row%, Col%, 0: PRINT Me$;
  826.     NEXT I%
  827.     LOCATE 11, 68: COLOR 11
  828.     Start% = &H400 + FarPeek%(&H40, &H80)
  829.     Finish% = &H400 + FarPeek%(&H40, &H82)
  830.     PRINT RIGHT$("0000" + HEX$(Start%), 4); " ";
  831.     PRINT RIGHT$("0000" + HEX$(Finish%), 4);
  832.     DO
  833.         Hd% = &H400 + FarPeek%(&H40, &H1A)
  834.         Tl% = &H400 + FarPeek%(&H40, &H1C)
  835.         LOCATE 11, 4: COLOR 11
  836.         PRINT RIGHT$("0000" + HEX$(Hd%), 4); " ";
  837.         PRINT RIGHT$("0000" + HEX$(Tl%), 4);
  838.         COLOR 13: LOCATE 9, 17: PRINT SPACE$(48);
  839.         LOCATE 9, 17 + ((Hd% - &H41E) \ 2) * 3: PRINT CHR$(25);
  840.         COLOR 12: LOCATE 13, 17: PRINT SPACE$(48);
  841.         LOCATE 13, 17 + ((Tl% - &H41E) \ 2) * 3: PRINT CHR$(24);
  842.         FOR I% = 0 TO 15
  843.             C% = FarPeek%(&H40, &H1E + (I% * 2))
  844.             S% = FarPeek%(&H40, &H1E + (I% * 2) + 1)
  845.             IF C% < 32 THEN Ky$ = "  " ELSE Ky$ = CHR$(C%) + " "
  846.             LOCATE 11, 17 + (I% * 3): COLOR 14: PRINT Ky$;
  847.             LOCATE 14, 17 + (I% * 3): COLOR 9
  848.             PRINT RIGHT$("0" + HEX$(C%), 2);
  849.             LOCATE 15, 17 + (I% * 3): COLOR 10
  850.             PRINT RIGHT$("0" + HEX$(S%), 2);
  851.         NEXT I%
  852.         IF Hd% >= Tl% THEN
  853.            Kys% = 16 - ((Hd% - Tl%) \ 2)
  854.         ELSE
  855.            Kys% = (Tl% - Hd%) \ 2
  856.         END IF
  857.         LOCATE 14, 76: IF Kys% = 16 THEN Kys% = 0
  858.         PRINT RIGHT$(" " + LTRIM$(RTRIM$(STR$(Kys%))), 2);
  859.         IF Kys% = 15 THEN
  860.            LOCATE 15, 67: COLOR 28: PRINT "BUFFER FULL";
  861.            SLEEP 2: KeyFlush: LOCATE , 67: PRINT SPACE$(11);
  862.         END IF
  863.     LOOP UNTIL FarPeek%(&H40, (Tl% - &H400) - 2) = 27
  864.     COLOR 7, 0: LOCATE 20, 1, 0
  865.     Dummy$ = INPUT$(Kys%)
  866. GOTO D400
  867.  
  868. '   Report mouse cursor position and status.
  869. '
  870. D440:
  871.     IF Mouse% THEN
  872.        Panel 4, 1, 21, 80, 1, TextColour%
  873.        CALL MouseShow
  874.        DO
  875.           MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  876.           Me$ = "x=" + LTRIM$(RTRIM$(STR$(xMouse%))) + "  "
  877.           FastPrint 12, 31, Me$, TextColour%
  878.           Me$ = "y=" + LTRIM$(RTRIM$(STR$(yMouse%))) + "  "
  879.           FastPrint 12, 41, Me$, TextColour%
  880.           IF leftButton% THEN
  881.              IF yMouse% > 15 AND yMouse% < 24 THEN
  882.                 EXIT DO
  883.              ELSE
  884.                 Me$ = "Left button pressed"
  885.              END IF
  886.           ELSE
  887.              Me$ = "                   "
  888.           END IF
  889.           FastPrint 14, 31, Me$, TextColour%
  890.           IF rightButton% THEN
  891.              Me$ = "Right button pressed"
  892.           ELSE
  893.              Me$ = "                    "
  894.           END IF
  895.           FastPrint 15, 31, Me$, TextColour%: Z$ = INKEY$
  896.        LOOP UNTIL Z$ = CHR$(27)
  897.        CALL MouseHide
  898.        IF Z$ <> CHR$(27) THEN GOTO D002
  899.     ELSE
  900.        MisTake 9, "Mouse driver not installed", 0, Mouse%
  901.     END IF
  902. GOTO D400
  903.  
  904. '┌────────────────────────────────────────────────────────────────────────┐
  905. '│      Memory-related functions and procedures.                          │
  906. '└────────────────────────────────────────────────────────────────────────┘
  907. '
  908. D500:
  909.     Menu$(0) = "FE"
  910.     Menu$(1) = "operating system Flags"
  911.     Menu$(2) = "Expanded memory services"
  912.     Abort% = FALSE
  913.     VerMenu 4, 26, BarColour%, 1, 2, "MEMORY", Menu$(),_
  914.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  915.     IF Nxt% THEN GOTO D002
  916.     SELECT CASE Choice%
  917.         CASE 1
  918.              GOTO D510
  919.         CASE 2
  920.              GOTO D520
  921.         CASE ELSE
  922.     END SELECT
  923. GOTO D002
  924.  
  925. '┌────────────────────────────────────────────────────────────────────────┐
  926. '│      System Flags.                                                     │
  927. '└────────────────────────────────────────────────────────────────────────┘
  928. '
  929. D510:
  930.     DIM CoOrd%(16, 2): Context% = 1: Topic$ = "FLAGS"
  931.     Panel 4, 1, 21, 80, 1, TextColour%: RESTORE Flags
  932.     FOR I% = 6 TO 21
  933.         READ Me$: FastPrint I%, 6, Me$, TextColour%
  934.     NEXT I%
  935.     Panel 6, 50, 16, 27, 2, 48
  936.     FastPrint 7, 53, "CURRENT FLAG SETTINGS", 48
  937.     FastPrint 8, 50, "╟" + STRING$(25, "─") + "╢", 48
  938.     FOR I% = 10 TO 17
  939.         READ Me$: FastPrint I%, 52, Me$, 48
  940.     NEXT I%
  941.     FOR I% = 1 TO 16
  942.         READ CoOrd%(I%, 1), CoOrd%(I%, 2): F% = GetFlag%(I%)
  943.         F$ = LTRIM$(RTRIM$(STR$(F%))): F$ = RIGHT$("   " + F$, 3)
  944.         FastPrint CoOrd%(I%, 1), CoOrd%(I%, 2), F$, 48
  945.     NEXT I%
  946.     FastPrint 19, 52, "Enter Flag Number:", 48
  947.     FastPrint 25, 3, SPACE$(78), StatColour%
  948.     FastPrint 25, 3, "Press <ESC> to Abort", StatColour%
  949.     DO
  950.        LOCATE 19, 73: HotKey% = FALSE
  951.        Number$ = RevInput$(2, Number$, 1, "REVINPUT", 0, HotKey%)
  952.        IF HotKey% THEN
  953.           Abort% = TRUE
  954.        ELSE   
  955.           Number% = VAL(Number$)
  956.           IF Number% < 1 OR Number% > 16 THEN
  957.              BEEP
  958.           ELSE
  959.              Number$ = LTRIM$(RTRIM$(STR$(Number%)))
  960.              Number$ = RIGHT$("  " + Number$, 2)
  961.              FastPrint 19, 73, Number$, 48
  962.              Setting% = GetFlag%(Number%)
  963.              Setting$ = RIGHT$("   " + LTRIM$(RTRIM$(STR$(Setting%))), 3)
  964.              LOCATE CoOrd%(Number%, 1), CoOrd%(Number%, 2)
  965.              Setting$ = RevInput$(3, Setting$, 1, "REVINPUT", 0, HotKey%)
  966.              IF HotKey% THEN
  967.                 Abort% = TRUE
  968.              ELSE   
  969.                 Setting% = VAL(Setting$)
  970.                 IF Setting% < 0 OR Setting% > 255 THEN
  971.                    BEEP
  972.                 ELSE
  973.                    SetFlag Number%, Setting%
  974.                 END IF
  975.                 Setting% = GetFlag%(Number%)
  976.                 Setting$ = RIGHT$("   " + LTRIM$(RTRIM$(STR$(Setting%))), 3)
  977.                 FastPrint CoOrd%(Number%, 1), CoOrd%(Number%, 2), Setting$, 48
  978.              END IF
  979.           END IF
  980.        END IF
  981.     LOOP UNTIL Abort%
  982.     ERASE CoOrd%: Frame Head$, 0
  983. GOTO D500
  984.  
  985. '┌────────────────────────────────────────────────────────────────────────┐
  986. '│      Expanded Memory services.                                         │
  987. '└────────────────────────────────────────────────────────────────────────┘
  988. '
  989. D520:
  990.     IF NOT EmsPresent% THEN
  991.        MisTake 9, "Sorry, no EXPANDED MEMORY available", 0, Mouse%
  992.        GOTO D500
  993.     END IF
  994.  
  995.     Panel 4, 1, 21, 80, 1, TextColour%: Handle% = FALSE
  996.     FastPrint 6, 23, "┌─────────────────────────────────┐", TextColour%
  997.     FastPrint 7, 23, "│  EXPANDED MEMORY DEMONSTRATION  │", TextColour%
  998.     FastPrint 8, 23, "└─────────────────────────────────┘", TextColour%
  999.     Version% = EmsVersion%: PageFrame% = EmsFrame%
  1000.     EmsTotal% = EmsPages%(0): EmsFree% = EmsPages%(1)
  1001.     LIM$ = LTRIM$(RTRIM$(STR$(Version%))): L% = LEN(LIM$)
  1002.     IF L% > 1 THEN LIM$ = LEFT$(LIM$, L% - 1) + "." + RIGHT$(LIM$, 1)
  1003.     Me$ = "You have" + STR$(EmsTotal% * 16) + " KiloBytes of LIM "_
  1004.         + LIM$ + " Expanded Memory installed."
  1005.     FastPrint 10, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1006.     Me$ = "The Page Frame segment is at address " + HEX$(PageFrame%) + " Hex,"
  1007.     FastPrint 11, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1008.     Me$ = "and there are" + STR$(EmsFree%) + " pages ("_
  1009.         + LTRIM$(RTRIM$(STR$(EmsFree% * 16))) + "KB) free."
  1010.     FastPrint 12, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1011.     IF EmsFree% < 4 THEN
  1012.        Me$ = "Sorry, that's not enough for this demonstration."
  1013.        FastPrint 15, 40 - (LEN(Me$) \ 2), Me$, TextColour%: GOTO D525
  1014.     END IF
  1015.     SLEEP 1: KeyFlush: Me$ = "Requesting four pages for this demonstration,"
  1016.     FastPrint 14, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1017.     EmsRequest 4, Handle%: IF Handle% = 0 THEN GOTO D529
  1018.     Pages% = EmsOwned%(Handle%): IF Pages% < 4 THEN GOTO D529
  1019.     Me$ = "they have been assigned to Handle" + STR$(Handle%) + "."
  1020.     FastPrint 15, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1021.     Me$ = "Saving this screen to page 1": SLEEP 1: KeyFlush
  1022.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1023.     IF Colour% THEN Segment% = &HB800 ELSE Segment% = &HB000
  1024.     SLEEP 1: KeyFlush: Me$ = "Drawing and saving three other screens ...."
  1025.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1026.     EmsPut Segment%, 0, 4000, 1, Handle%, Done%
  1027.     IF NOT Done% THEN GOTO D529
  1028.     SLEEP 1: KeyFlush: FastPrint 25, 1, SPACE$(80), StatColour%
  1029.     Page% = 2: Row% = 11: Col% = 35
  1030.     RESTORE Numbers
  1031.     DO
  1032.         READ Columns%, BackGround%: IF NOT Colour% THEN BackGround% = 0
  1033.         Attr% = Attribute%(15, BackGround%)
  1034.         BackFill 4, 1, 21, 80, Attr%
  1035.         Scroll 1, 9, 2, 23, 79, 0, Attr%
  1036.         FastPrint 10, 36, "P A G E", Attr%
  1037.         FOR I% = 1 TO Columns%
  1038.             READ Item$: IF Item$ = "F" THEN Item$ = "12345678"
  1039.             FOR J% = 1 TO LEN(Item$)
  1040.                 Rows% = VAL(MID$(Item$, J%, 1))
  1041.                 FastPrint Row% + Rows%, Col% + I%, CHR$(219), Attr%
  1042.             NEXT J%
  1043.         NEXT I%
  1044.         EmsPut Segment%, 0, 4000, Page%, Handle%, Done%
  1045.         Page% = Page% + 1: IF NOT Done% THEN EXIT DO
  1046.         SLEEP 1: KeyFlush
  1047.     LOOP UNTIL Page% > 4
  1048.     IF NOT Done% THEN GOTO D529
  1049.     EmsGet Segment%, 0, 4000, 1, Handle%, Done%
  1050.     IF NOT Done% THEN GOTO D529
  1051.     Me$ = "Now I'll let YOU bring 'em back again ...."
  1052.     FastPrint 19, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1053.     FastPrint 22, 24, "Press a key when you're ready >", TextColour%
  1054.     LOCATE 22, 56, 1: Page% = 4: IF KeyIn% = 27 THEN GOTO D525
  1055.     DO
  1056.        EmsGet Segment%, 0, 4000, Page%, Handle%, Done%
  1057.        IF NOT Done% THEN EXIT DO
  1058.        FastPrint 25, 63, "Press a key >", StatColour%
  1059.        LOCATE 25, 77: KeyPress% = KeyIn%
  1060.        Page% = Page% - 1
  1061.     LOOP WHILE Page% > 1
  1062.     IF Done% THEN EmsGet Segment%, 0, 4000, 1, Handle%, Done%
  1063.     LOCATE , , 0: IF NOT Done% THEN GOTO D529
  1064.     Me$ = "The demonstration was completely successful, which proves that"
  1065.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1066.     Me$ = "your Expanded Memory is in good working order."
  1067.     FastPrint 18, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1068. D525:
  1069.     IF Handle% THEN
  1070.        SLEEP 1: KeyFlush: EmsRelease Handle%
  1071.        Me$ = "We released all pages assigned to handle" + STR$(Handle%)_
  1072.            + " before finishing,"
  1073.        FastPrint 20, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1074.        Me$ = "otherwise no other program would have been able to use them."
  1075.        FastPrint 21, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1076.     END IF
  1077.     SLEEP 2: KeyFlush
  1078. GOTO D500
  1079.  
  1080. D529:
  1081.     Me$ = "An EMM error" + STR$(EmsError%) + " has just occurred ..."
  1082.     MisTake 12, Me$, 0, Mouse%
  1083. GOTO D525
  1084.  
  1085. '┌────────────────────────────────────────────────────────────────────────┐
  1086. '│      Miscellaneous functions and procedures.                           │
  1087. '└────────────────────────────────────────────────────────────────────────┘
  1088. '
  1089. D600:
  1090.     Menu$(0) = "DHEFP"
  1091.     Menu$(1) = "Date entry and validation"
  1092.     Menu$(2) = "Hardware equipment list"
  1093.     Menu$(3) = "Encryption of text"
  1094.     Menu$(4) = "Fast string sorting"
  1095.     Menu$(5) = "Pathname for help files"
  1096.     Abort% = FALSE
  1097.     VerMenu 4, 35, BarColour%, 1, 5, "EXAMPLES", Menu$(),_
  1098.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  1099.     IF Nxt% THEN GOTO D002
  1100.     SELECT CASE Choice%
  1101.         CASE 1
  1102.              GOTO D610
  1103.         CASE 2
  1104.              GOTO D620
  1105.         CASE 3
  1106.              GOTO D630
  1107.         CASE 4
  1108.              GOTO D640
  1109.         CASE 5
  1110.              GOTO D650
  1111.         CASE ELSE
  1112.     END SELECT
  1113. GOTO D002
  1114.  
  1115. '┌────────────────────────────────────────────────────────────────────────┐
  1116. '│      Long Date Routine.                                                │
  1117. '└────────────────────────────────────────────────────────────────────────┘
  1118. '
  1119. D610:
  1120.     IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1121.     HotKey% = FALSE: IF ToDay$ = "" THEN ToDay$ = SPACE$(20)
  1122.     Context% = 1: Topic$ = "LONGDATE": WW% = LEN(ToDay$)
  1123.     WT% = 41 - (WW% \ 2): PopUp 8, 24, 8, 34, Attrib%, 3, 2, -1
  1124.     FastPrint 9, 33, "Today's date is:", Attrib%
  1125.     FastPrint 10, WT%, ToDay$, Attrib%
  1126.     Ok% = Verify%(1, 12, "Is this correct", 0, Mouse%)
  1127.     IF NOT Ok% THEN
  1128.        FastPrint 12, 32, "Enter correct date", Attrib%
  1129.        Temp$ = "": LOCATE 14, 37
  1130.        Temp$ = DateInput$(Temp$, 1, "DATINPUT", HotKey%)
  1131.        IF HotKey% THEN
  1132.           Abort% = TRUE
  1133.        ELSE   
  1134.           Now$ = Temp$: MO% = VAL(MID$(Temp$, 4, 2))
  1135.           DY% = VAL(LEFT$(Temp$, 2)): YR% = VAL(RIGHT$(Temp$, 2))
  1136.           ToDay$ = LongDate$(DY%, MO%, YR%): OL% = LEN(ToDay$)
  1137.           IF OL% > 0 THEN
  1138.              FastPrint 25, 41, SPACE$(40), StatColour%
  1139.              FastPrint 25, 79 - OL%, ToDay$, StatColour%
  1140.           END IF
  1141.        END IF
  1142.     END IF
  1143.     ShutUp -1
  1144. GOTO D600
  1145.  
  1146. '┌────────────────────────────────────────────────────────────────────────┐
  1147. '│      Equipment List.                                                   │
  1148. '└────────────────────────────────────────────────────────────────────────┘
  1149. '
  1150. D620:
  1151.     Panel 4, 1, 21, 80, 1, TextColour%
  1152.     Cols$ = "80": Video$ = "colour": REDIM Model(0 TO 8) AS STRING
  1153.     RESTORE HWare: FOR I% = 0 TO 8: READ Model(I%): NEXT
  1154.     Equipment% = PeekWord&(&H40, &H10): Flag$ = STRING$(16, "0")
  1155.     Computer% = FarPeek%(&HF000, &HFFFE)
  1156.     Computer% = Computer% - &HF8: IF Computer% < 0 THEN Computer% = 0
  1157.     FastPrint 8, 38, "IBM " + Model(Computer%) + " or compatible", TextColour%
  1158.     Chip% = Cpu%: CoPro% = MathsChip%
  1159.     SELECT CASE Chip%
  1160.         CASE IS < 0
  1161.              Me$ = " an Intel 80C" + LTRIM$(RTRIM$(STR$(ABS(Chip%))))
  1162.         CASE 20, 30
  1163.              Me$ = " a NEC V" + LTRIM$(RTRIM$(STR$(Chip%)))
  1164.         CASE 88 TO 486
  1165.              Me$ = " an Intel 80" + LTRIM$(RTRIM$(STR$(Chip%)))
  1166.         CASE ELSE
  1167.              Me$ = " an unknown"
  1168.     END SELECT
  1169.     Me$ = "with" + Me$ + " microprocessor"
  1170.     FastPrint 9, 38, Me$, TextColour%
  1171.     FOR I% = 15 TO 0 STEP -1
  1172.         IF BitTest%(Equipment%, I%) THEN
  1173.            MID$(Flag$, 16 - I%, 1) = "1"
  1174.         END IF
  1175.     NEXT I%
  1176.     FastPrint 8, 3, " F E D C B A 9 8 7 6 5 4 3 2 1 0", TextColour%
  1177.     FastPrint 9, 3, "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐", TextColour%
  1178.     FastPrint 10, 3, "│", TextColour%: Col% = 4
  1179.     FOR I% = 1 TO 16
  1180.         FastPrint 10, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  1181.         Col% = Col% + 2
  1182.     NEXT I%
  1183.     FastPrint 10, 38, "ROM BIOS Equipment Flag at 0040:0010", TextColour%
  1184.     FastPrint 11, 3, "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘", TextColour%
  1185.     FastPrint 12, 3, " │ │   │ │ │ │   │ │ │ │ │ │ │ │", TextColour%
  1186.     FastPrint 13, 3, " │ │   │ │ │ │   │ │ │ │ │ │ │ └─", TextColour%
  1187.     FastPrint 14, 3, " │ │   │ │ │ │   │ │ │ │ │ │ └───", TextColour%
  1188.     FastPrint 15, 3, " │ │   │ │ │ │   │ │ │ │ └─┴─────", TextColour%
  1189.     FastPrint 16, 3, " │ │   │ │ │ │   │ │ └─┴─────────", TextColour%
  1190.     FastPrint 17, 3, " │ │   │ │ │ │   └─┴─────────────", TextColour%
  1191.     FastPrint 18, 3, " │ │   │ └─┴─┴───────────────────", TextColour%
  1192.     FastPrint 19, 3, " │ │   └─────────────────────────", TextColour%
  1193.     FastPrint 20, 3, " └─┴─────────────────────────────", TextColour%
  1194.     FastPrint 13, 38, "Floppy drives installed?", TextColour%
  1195.     IF MID$(Flag$, 16, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1196.     FastPrint 13, 68, Me$, TextColour%
  1197.     FastPrint 14, 38, "Maths coprocessor installed?", TextColour%
  1198.     IF MID$(Flag$, 15, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1199.     IF CoPro% > 0 THEN Me$ = "80" + LTRIM$(RTRIM$(STR$(CoPro%)))
  1200.     FastPrint 14, 68, Me$, TextColour%
  1201.     FastPrint 15, 38, "Original PC motherboard RAM", TextColour%
  1202.     IF Computer% = 1 THEN
  1203.        Ram% = (BinDec&(MID$(Flag$, 13, 2)) + 1) * 16
  1204.        Me$ = RIGHT$("  " + LTRIM$(RTRIM$(STR$(Ram%))), 2) + "KB"
  1205.     ELSE
  1206.        Me$ = "n/a"
  1207.     END IF
  1208.     FastPrint 15, 68, Me$, TextColour%
  1209.     FastPrint 16, 38, "Initial Video mode", TextColour%
  1210.     Mode% = BinDec&(MID$(Flag$, 11, 2))
  1211.     IF Mode% = 1 THEN Cols$ = "40"
  1212.     IF Mode% = 7 THEN Video$ = "mono"
  1213.     FastPrint 16, 58, Cols$ + " column " + Video$, TextColour%
  1214.     FastPrint 17, 38, "Number of floppy drives", TextColour%
  1215.     Mode% = BinDec&(MID$(Flag$, 9, 2)) + 1
  1216.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 17, 68, Me$, TextColour%
  1217.     FastPrint 18, 38, "Number of serial ports", TextColour%
  1218.     Mode% = BinDec&(MID$(Flag$, 5, 3)) + 1
  1219.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 18, 68, Me$, TextColour%
  1220.     FastPrint 19, 38, "Games adaptor installed?", TextColour%
  1221.     IF MID$(Flag$, 3, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1222.     FastPrint 19, 68, Me$, TextColour%
  1223.     FastPrint 20, 38, "Number of parallel printers", TextColour%
  1224.     Mode% = BinDec&(LEFT$(Flag$, 2))
  1225.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 20, 68, Me$, TextColour%
  1226.     FastPrint 25, 1, SPACE$(80), StatColour%
  1227.     FastPrint 25, 3, "Press a key to continue", StatColour%
  1228.     IF Mouse% THEN MouseShow
  1229.     DO
  1230.        IF Mouse% THEN
  1231.           MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  1232.           IF leftButton% THEN
  1233.              IF yMouse% > 15 AND yMouse% < 24 THEN
  1234.                 Z$ = "": EXIT DO
  1235.              END IF
  1236.           END IF
  1237.        END IF
  1238.        Z$ = INKEY$
  1239.     LOOP WHILE Z$ = ""
  1240.     Frame Head$, 0: ERASE Model
  1241.     IF Mouse% THEN
  1242.        CALL MouseHide: IF Z$ = "" THEN GOTO D002
  1243.     END IF
  1244. GOTO D600
  1245.  
  1246. '   Text Encryption.
  1247. '
  1248. D630:
  1249.     Panel 4, 1, 21, 80, 1, TextColour%
  1250.     Done% = FALSE: Abort% = FALSE: HotKey% = FALSE
  1251.     Text$ = "": Code$ = ""
  1252.     RESTORE Crypt
  1253.     FOR I% = 1 TO 5
  1254.         READ Me$: FastPrint 6 + I%, 11, Me$, TextColour%
  1255.     NEXT I%
  1256.     IF Colour% THEN Attrib% = 32 ELSE Attrib% = 112
  1257.     DO WHILE Text$ = ""
  1258.        PopUp 17, 19, 4, 44, Attrib%, 2, 2, -1
  1259.        FastPrint 18, 27, "Enter string to be encrypted", Attrib%
  1260.        LOCATE 19, 21: Text$ = RevInput$(40, "", 1, "REVINPUT", -1, HotKey%)
  1261.        ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1262.        Text$ = LTRIM$(RTRIM$(Text$))
  1263.        IF Text$ = "" THEN
  1264.           MisTake 9, "You can't encrypt an empty string!", 0, Mouse%
  1265.        END IF
  1266.     LOOP
  1267.     IF NOT Abort% THEN
  1268.        IF Colour% THEN Attrib% = 78 ELSE Attrib% = 112
  1269.        DO WHILE Code$ = ""
  1270.           PopUp 17, 19, 4, 44, Attrib%, 2, 2, -1
  1271.           FastPrint 18, 25, "Enter string to encrypt it with", Attrib%
  1272.           LOCATE 19, 21: Code$ = RevInput$(40, "", 1, "REVINPUT", -1, HotKey%)
  1273.           ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1274.           Code$ = LTRIM$(RTRIM$(Code$))
  1275.           IF Code$ = "" THEN
  1276.              MisTake 12, "An empty string is no use!", 0, Mouse%
  1277.           END IF
  1278.        LOOP
  1279.        IF NOT Abort% THEN
  1280.           Cipher Text$, Code$: Me$ = "Encrypted string >  " + Text$
  1281.           FastPrint 14, 11, Me$, TextColour%
  1282.           IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1283.           DO
  1284.              DO
  1285.                 PopUp 19, 19, 4, 44, Attrib%, 2, 2, -1
  1286.                 FastPrint 20, 27, "Enter key string once again", Attrib%
  1287.                 LOCATE 21, 21
  1288.                 DeCode$ = RevInput$(40, "", 1, "REVINPUT", -1, HotKey%)
  1289.                 ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1290.                 DeCode$ = LTRIM$(RTRIM$(DeCode$))
  1291.                 IF DeCode$ = "" THEN
  1292.                    MisTake 12, "An empty string is no use!", 0, Mouse%
  1293.                 END IF
  1294.              LOOP WHILE DeCode$ = ""
  1295.              IF Abort% THEN
  1296.                 Done% = TRUE
  1297.              ELSE
  1298.                 Me$ = Text$: Cipher Me$, DeCode$
  1299.                 Me$ = "Decrypted string >  " + Me$
  1300.                 FastPrint 16, 11, Me$, TextColour%
  1301.                 IF Code$ = DeCode$ THEN
  1302.                    FastPrint 19, 33, "That's the one!", TextColour%
  1303.                    Done% = TRUE
  1304.                 ELSE
  1305.                    Me$ = "Whoops, that's not right"
  1306.                    IF MisMatch% THEN
  1307.                       Me$ = Me$ + " either"
  1308.                    END IF
  1309.                    MisTake 9, Me$ + "!", 0, Mouse%
  1310.                    MisMatch% = TRUE
  1311.                 END IF
  1312.              END IF
  1313.           LOOP UNTIL Done%
  1314.        END IF
  1315.     END IF
  1316. GOTO D600
  1317.  
  1318. '   Demonstrate string array sorting and scan routines.
  1319. '
  1320. D640:
  1321.     Room% = TRUE: Me$ = "Not enough memory for sort array"
  1322.     ON ERROR GOTO D645
  1323.     REDIM Array(1 TO 1000) AS STRING
  1324.     ON ERROR GOTO Trap
  1325.     IF NOT Room% THEN GOTO D600
  1326.     RESTORE Strings: IF Colour% THEN COLOR 0, 7
  1327.     Panel 4, 1, 21, 80, 1, TextColour%
  1328.     FOR Row% = 6 TO 7
  1329.         READ Me$: LOCATE Row%, 3: PRINT Me$
  1330.     NEXT Row%
  1331.     FOR I% = 1 TO 1000
  1332.         FOR J% = 1 TO Rand%(5, 11)
  1333.             Array(I%) = Array(I%) + CHR$(Rand%(0, 25) + 65)
  1334.         NEXT J%
  1335.     NEXT I%
  1336.     LOCATE 7, 50: PRINT "done!"
  1337.     LOCATE 9, 3: PRINT "Unsorted array"
  1338.     FOR I% = 1 TO 3
  1339.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1340.         LOCATE 10 + I%, 3: PRINT Me$; " "; Array(I%)
  1341.     NEXT I%
  1342.     LOCATE 14, 3: PRINT "  .": Row% = 15
  1343.     FOR I% = 998 TO 1000
  1344.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1345.         LOCATE Row%, 3: PRINT Me$; " "; Array(I%): Row% = Row% + 1
  1346.     NEXT I%
  1347.     PopUp 19, 13, 5, 53, BarColour%, 4, 4, 0
  1348.     READ Me$: FastPrint 21, 15, Me$, BarColour%
  1349.     LOCATE 21, 62: A$ = UCASE$(RevInput$(1, "A", 1, "REVINPUT", 0, HotKey%))
  1350.     ShutUp 0: IF Colour% THEN COLOR 0, 7
  1351.     IF HotKey% THEN Abort% = TRUE: GOTO D642
  1352.     IF A$ = "D" THEN
  1353.        Direction% = 1: A$ = "descending"
  1354.     ELSE
  1355.        Direction% = 0: A$ = "ascending"
  1356.     END IF
  1357.     LOCATE 19, 3: PRINT "Sorting the array into "; A$; " order ....";
  1358.     First% = LBOUND(Array): Last% = UBOUND(Array)
  1359.     X! = TIMER
  1360.     StringSort Direction%, 1000, VARPTR(Array(First%))
  1361.     Y! = TIMER
  1362.     PRINT " done!": LOCATE 9, 41: PRINT "Sorted array"
  1363.     FOR I% = 1 TO 3
  1364.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1365.         LOCATE 10 + I%, 41: PRINT Me$; " "; Array(I%)
  1366.     NEXT I%
  1367.     LOCATE 14, 41: PRINT "  .": Row% = 15
  1368.     FOR I% = 998 TO 1000
  1369.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1370.         LOCATE Row%, 41: PRINT Me$; " "; Array(I%): Row% = Row% + 1
  1371.     NEXT I%
  1372.     LOCATE 20, 3: PRINT USING "The sort took ###.### seconds"; Y! - X!
  1373.     Ok% = Verify%(1, 16, "Search array", 0, Mouse%): IF NOT Ok% THEN GOTO D642
  1374. D641:
  1375.     PopUp 12, 17, 8, 46, BarColour%, 3, 4, -1: HotKey% = 0
  1376.     FastPrint 14, 20, "Enter a string to insert into the array", BarColour%
  1377.     LOCATE 15, 30: A$ = RevInput$(20, "", 1, "REVINPUT", 0, HotKey%)
  1378.     IF HotKey% THEN Abort% = TRUE: ShutUp -1: GOTO D642
  1379.     A$ = LTRIM$(RTRIM$(A$))
  1380.     Me$ = "Enter element to insert it into (1-"_
  1381.         + LTRIM$(RTRIM$(STR$(Last%))) + ") "
  1382.     FastPrint 16, 40 - (LEN(Me$) \ 2), Me$, BarColour%
  1383.     LOCATE 17, 38: Temp$ = RevInput$(4, "", 1, "REVINPUT", 0, HotKey%)
  1384.     ShutUp -1: IF Colour% THEN COLOR 0, 7
  1385.     IF HotKey% THEN
  1386.        Abort% = TRUE: GOTO D642
  1387.     ELSE
  1388.        S% = VAL(Temp$)
  1389.        IF S% < First% OR S% > Last% THEN
  1390.           MisTake 9, "OUT OF RANGE!", 0, Mouse%
  1391.           GOTO D641
  1392.        ELSE
  1393.           Array(S%) = A$
  1394.           IF S% < 4 THEN
  1395.              LOCATE 10 + S%, 54: PRINT SPACE$(12);
  1396.              LOCATE 10 + S%, 54: PRINT A$;
  1397.           ELSEIF S% > 997 THEN
  1398.              LOCATE S% - 983, 54: PRINT SPACE$(12);
  1399.              LOCATE S% - 983, 54: PRINT A$;
  1400.           END IF
  1401.        END IF
  1402.     END IF
  1403.     LOCATE 21, 3: PRINT "Scanning array for " + A$ + " .... ";
  1404.     X! = TIMER
  1405.     Match% = StringScan%(A$, 1000, First%, VARPTR(Array$(First%)))
  1406.     Y! = TIMER
  1407.     PRINT "found it at element"; Match%
  1408.     LOCATE 22, 3: PRINT USING "The search took ###.### seconds"; Y! - X!
  1409. D642:
  1410.     ERASE Array: IF Colour% THEN COLOR 7, 0
  1411. GOTO D002
  1412.  
  1413. D645:
  1414.     MisTake 9, Me$, 0, Mouse%
  1415.     Room% = FALSE
  1416. RESUME NEXT
  1417.  
  1418. '   Set the environment directory path for Helpmate topic files.
  1419. '
  1420. D650:
  1421.     Panel 4, 1, 21, 80, 1, TextColour%
  1422.     Row% = 5: RESTORE Path
  1423.     FOR I% = 0 TO 12
  1424.         READ Me$: FastPrint Row% + I%, 14, Me$, TextColour%
  1425.     NEXT I%
  1426.     HelPath$ = ENVIRON$("HELP"): Temp$ = HelPath$
  1427.     PopUp 19, 11, 5, 57, Attribute%(14, 6), 3, 4, 0
  1428.     READ Me$: FastPrint 20, 20, Me$, Attribute%(14, 6)
  1429.     READ Me$: FastPrint 22, 14, Me$, Attribute%(14, 6)
  1430.     LOCATE 21, 14: Temp$ = RevInput$(51, Temp$, 1, "REVINPUT", 0, HotKey%)
  1431.     ShutUp 0
  1432.     IF HotKey% THEN
  1433.        Abort% = TRUE
  1434.     ELSE
  1435.        Me$ = "Environment table full"
  1436.        HelPath$ = "HELP=" + LTRIM$(RTRIM$(Temp$))
  1437.        ON ERROR GOTO D645
  1438.        ENVIRON HelPath$
  1439.        ON ERROR GOTO Trap
  1440.     END IF
  1441. GOTO D600
  1442.  
  1443. '┌────────────────────────────────────────────────────────────────────────┐
  1444. '│      Program Exit.                                                     │
  1445. '└────────────────────────────────────────────────────────────────────────┘
  1446. '
  1447. D700:
  1448.     Menu$(0) = "ED"
  1449.     Menu$(1) = "Exit program"
  1450.     Menu$(2) = "DOS shell"
  1451.     VerMenu 4, 49, BarColour%, 1, 2, "EXIT", Menu$(),_
  1452.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  1453.     IF Nxt% THEN GOTO D002
  1454.     SELECT CASE Choice%
  1455.         CASE 1
  1456.              GOTO D710
  1457.         CASE 2
  1458.              GOTO D720
  1459.         CASE ELSE
  1460.     END SELECT
  1461. GOTO D002
  1462.  
  1463. '   Program Exit
  1464. '
  1465. D710:
  1466.     IF Colour% THEN
  1467.        Scroll 1, 1, 1, 25, 80, 0, Attribute%(15, 1)
  1468.        COLOR , , 1: Attrib% = 32
  1469.     ELSE
  1470.        FOR I% = 1 TO 24
  1471.            FastPrint I%, 1, STRING$(80, "░"), 7
  1472.        NEXT I%
  1473.        Attrib% = 112
  1474.     END IF
  1475.     PopUp 3, 2, 9, 44, Attrib%, 3, 2, -1: RESTORE Credits
  1476.     FOR I% = 4 TO 9
  1477.         READ Me$: FastPrint I%, 4, Me$, Attrib%
  1478.     NEXT I%    
  1479.     SLEEP 5: KeyFlush
  1480.     IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1481.     PopUp 10, 29, 11, 50, Attrib%, 2, 1, -1
  1482.     FOR I% = 11 TO 19
  1483.         READ Me$: FastPrint I%, 31, Me$, Attrib%
  1484.     NEXT I%
  1485.     SLEEP 10: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 1
  1486.     CALL KeyFlush: CLS
  1487. GOTO Egress
  1488.  
  1489. '┌────────────────────────────────────────────────────────────────────────┐
  1490. '│      Operating System Shell.                                           │
  1491. '└────────────────────────────────────────────────────────────────────────┘
  1492. '
  1493. D720:
  1494.     Scroll 1, 3, 1, 25, 80, 0, 7
  1495.     Me$ = "Enter the command 'EXIT' when you are ready to return."
  1496.     FastPrint 10, 40 - (LEN(Me$) \ 2), Me$, 14
  1497.     LOCATE 13, 1, 1: ON ERROR GOTO D721
  1498.     SHELL
  1499.     ON ERROR GOTO Trap
  1500.     GOTO D001
  1501. D721:
  1502.     ON ERROR GOTO Trap
  1503.     IF ERR = 5 THEN
  1504.        MisTake 9, "Cannot load secondary Command Processor", 0, Mouse%
  1505.        RESUME D700
  1506.     END IF
  1507.  
  1508. '┌────────────────────────────────────────────────────────────────────────┐
  1509. '│      Error Trap.                                                       │
  1510. '└────────────────────────────────────────────────────────────────────────┘
  1511. '
  1512. Trap:
  1513.     Fatal% = TRUE
  1514.     SELECT CASE ERR
  1515.         CASE 7, 14
  1516.              Me$ = "Out of memory"
  1517.         CASE 27
  1518.              Me$ = "PRINTER NOT READY": Fatal% = FALSE
  1519.         CASE 61, 67
  1520.              Me$ = "Out of disk space"
  1521.         CASE 71
  1522.              Me$ = "DISK DRIVE NOT READY": Fatal% = FALSE
  1523.         CASE 72
  1524.              Me$ = "Disk media error"
  1525.         CASE ELSE
  1526.              A$ = STR$(ERR): Me$ = "A type" + A$ + " Error has just occurred"
  1527.     END SELECT
  1528.     IF Fatal% THEN
  1529.        Me$ = Me$ + ", aborting to DOS ..."
  1530.        SL% = StatusLine%(Me$)
  1531.        RESUME Egress
  1532.     ELSE
  1533.        ML% = LEN(Me$): MT% = 40 - (ML% \ 2)
  1534.        IF Colour% THEN Attrib% = 78 ELSE Attrib% = 112
  1535.        PopUp 9, 20, 7, 42, Attrib%, 3, 2, -1
  1536.        FastPrint 10, MT%, Me$, Attrib% + 128: BEEP
  1537.        Me$ = "Please correct this error if possible"
  1538.        FastPrint 12, 22, Me$, Attrib%
  1539.        FastPrint 13, 30, "Press a key when ready", Attrib%
  1540.        FastPrint 14, 32, "or <ESC> to Abort.", Attrib%
  1541.        Character% = KeyIn%: ShutUp -1
  1542.        IF Character% = 27 THEN RESUME Egress
  1543.        RESUME
  1544.     END IF
  1545. Egress:
  1546.     Attr% = SCREEN(20, 1, 1)
  1547.     Curtains 25, 255: Curtains 25, 31: Curtains 25, Attr%
  1548.     LOCATE 20, 1, 1: ClearEnd 1, Attr%
  1549. END
  1550.  
  1551. '┌────────────────────────────────────────────────────────────────────────┐
  1552. '│     Program specific functions and procedures.                         │
  1553. '└────────────────────────────────────────────────────────────────────────┘
  1554. '
  1555. '   Draws or refreshes the main display screen. If switch is zero, only the
  1556. '   status line is refreshed.
  1557. '
  1558. SUB Frame (Title$, Switch%) STATIC
  1559.     SHARED StatColour%, HeadColour%, TextColour%, ToDay$
  1560.     IF Switch% THEN
  1561.        Scroll 1, 1, 1, 3, 80, 0, HeadColour%
  1562.        IF Title$ <> "" THEN
  1563.           FastPrint 1, 40 - (LEN(Title$) \ 2), Title$, HeadColour%
  1564.        END IF
  1565.        FastPrint 2, 1, STRING$(80, "─"), HeadColour%
  1566.        Panel 4, 1, 21, 80, 1, TextColour%
  1567.     END IF
  1568.     FastPrint 25, 1, SPACE$(80), StatColour%
  1569.     FastPrint 25, 4, "Press <F1> for Help, <ESC> to Abort", StatColour%
  1570.     IF ToDay$ <> "" THEN
  1571.        FastPrint 25, 78 - LEN(ToDay$), ToDay$, StatColour%
  1572.     END IF
  1573. END SUB
  1574.  
  1575. '┌────────────────────────────────────────────────────────────────────────┐
  1576. '│     Data Division.                                                     │
  1577. '└────────────────────────────────────────────────────────────────────────┘
  1578. '
  1579. Blurb:
  1580.     DATA "The Library modules on this disk provide you"
  1581.     DATA "with all the facilities necessary for you to"
  1582.     DATA "implement a full range of window features in"
  1583.     DATA "your programs.  With just one statement, for"
  1584.     DATA "instance, you can 'Pop-up' a window onto the"
  1585.     DATA "screen."
  1586.     DATA "The window can be a simple rectangle, in any"
  1587.     DATA "the QuickBASIC background colors, such as .."
  1588.     DATA "Alternatively it may have a border in one of"
  1589.     DATA "eight styles ...."
  1590.     DATA "The border itself may be in any one of the"
  1591.     DATA "QuickBASIC foreground colors. It can blink"
  1592.     DATA "if you want it to ..."
  1593.     DATA "The window, too, can be presented in several"
  1594.     DATA "different ways. It can be flat..."
  1595.     DATA "or it can have a black shadow underneath, to"
  1596.     DATA "give a three-dimensional effect..."
  1597.     DATA "Once you have a window on the screen, simply"
  1598.     DATA "use FASTPRINT, also in the TOOLBOX Library, "
  1599.     DATA "to put text into it, in any colour you like."
  1600.     DATA "You can also use the SCROLL routine from the"
  1601.     DATA "same source, to clear the window's contents."
  1602.     DATA "All the functions in the Library are written"
  1603.     DATA "in fast assembly language, but this does not"
  1604.     DATA "prevent them from being very easy to use."
  1605.     DATA "This for instance, is the call to create the"
  1606.     DATA "present window ....."
  1607.     DATA "   PopUp 8, 14, 8, 52, 112, 2, 0, -1"
  1608.     DATA "Before opening a window, the function stores"
  1609.     DATA "the screen beneath it in an internal buffer."
  1610.     DATA "When you close a window, the screen contents"
  1611.     DATA "are restored to their original location. Use"
  1612.     DATA "the statement 'ShutUp -1' to close the last"
  1613.     DATA "window opened.  For example ...."
  1614.     DATA "The Library includes several functions which"
  1615.     DATA "apply windowing techniques. The HELP screen,"
  1616.     DATA "which is available at the front menu, is one"
  1617.     DATA "example. Another is the VERIFY BOX which you"
  1618.     DATA "can use to collect a Yes/No response from an"
  1619.     DATA "operator, without redrawing the display."
  1620.     DATA "Another utility is the STATUS LINE MESSAGE,"
  1621.     DATA "which can be used to pause execution of the"
  1622.     DATA "program until the operator presses a key."
  1623.     DATA "You can display any prompt message you like"
  1624.     DATA "and the function will return the ASCII code"
  1625.     DATA "of the key which was pressed."
  1626.     DATA "I often use StatusLine in conjunction with a"
  1627.     DATA "routine which checks if the printer is ready"
  1628.     DATA "or not.  This gives the user a chance to fix"
  1629.     DATA "the printer,  if it is just out of paper, or"
  1630.     DATA "to abandon printing, if it is a more serious"
  1631.     DATA "problem. PrinTest is included here too."
  1632.  
  1633. Flags:
  1634.     DATA "The ASSEMBLY-LANGUAGE TOOLBOX includes a"
  1635.     DATA "pair  of functions which give you access"
  1636.     DATA "to  the  INTRA-APPLICATION COMMUNICATION"
  1637.     DATA "AREA (IAC),  an area of memory which has"
  1638.     DATA "been reserved,  by DOS, so that programs"
  1639.     DATA "can communicate with each other. The IAC"
  1640.     DATA "is 16 bytes long and is located,  in low"
  1641.     DATA "RAM at addresses 0000:04F0 - 04FF (Hex)."
  1642.     DATA "Once set, an IAC flag retains it's value"
  1643.     DATA "until  you reset it,  or the computer is"
  1644.     DATA "rebooted."
  1645.     DATA "Since QuickBASIC programs, compiled with"
  1646.     DATA "the /O switch to run stand-alone, cannot"
  1647.     DATA "pass variables to chain modules, you can"
  1648.     DATA "use  this feature to implement a limited"
  1649.     DATA "form of parameter passing."
  1650.     DATA "1.4F0h       9.4F8h", "2.4F1h      10.4F9h"
  1651.     DATA "3.4F2h      11.4FAh", "4.4F3h      12.4FBh"
  1652.     DATA "5.4F4h      13.4FCh", "6.4F5h      14.4FDh"
  1653.     DATA "7.4F6h      15.4FEh", "8.4F7h      16.4FFh"
  1654.     DATA 10, 59, 11, 59, 12, 59, 13, 59, 14, 59, 15, 59
  1655.     DATA 16, 59, 17, 59, 10, 72, 11, 72, 12, 72, 13, 72
  1656.     DATA 14, 72, 15, 72, 16, 72, 17, 72
  1657.  
  1658. Finder:
  1659.     DATA "This function allows you to find out if a particular"
  1660.     DATA "file is present on any disk drive in the system."," "
  1661.     DATA "Enter the name of the file which you want to locate,"
  1662.     DATA "including the drive letter and directory pathname if"
  1663.     DATA "required.  You can use an ambiguous name,  including"
  1664.     DATA "the wildcard characters (* and ?).  In this case the"
  1665.     DATA "function will pop up a directory window containing a"
  1666.     DATA "list of all files that match. You can select the one"
  1667.     DATA "you are interested in,  by high-lighting it with the"
  1668.     DATA "cursor arrow keys and pressing <RETURN>. The routine"
  1669.     DATA "returns a string containing the full pathname of the"
  1670.     DATA "file which you have selected."
  1671.  
  1672. Sorts:
  1673.     DATA "SORTFILE sorts ASCII text files. You supply the name, which may"
  1674.     DATA "include a directory pathname, and the start position and length"
  1675.     DATA "of the field which the file is to be sorted on.", " "
  1676.     DATA "The program first checks the size of the file and the amount of"
  1677.     DATA "free disk space to see if the it can be sorted in memory, this"
  1678.     DATA "requires space for two copies of the file on disk. If it is too"
  1679.     DATA "large, the file is sorted in place so that no extra disk space"
  1680.     DATA "is required. Using this method, which is far slower, the file"
  1681.     DATA "may be of any size up to 4 Gigabytes."
  1682.  
  1683. Size:
  1684.     DATA "THIS PROGRAM REPORTS THE SIZE OF FILES WHICH YOU SPECIFY"
  1685.     DATA "--------------------------------------------------------", " "
  1686.     DATA "The filename can include a directory path and may be ambiguous,"
  1687.     DATA "using the wildcard characters '*' and '?'. The program will"
  1688.     DATA "return the size of the file, in bytes, or, if more than one"
  1689.     DATA "match is found, the total size of all the files. If a size of"
  1690.     DATA "zero is returned, the file does not exist (at least not in the"
  1691.     DATA "directory specified).", " "
  1692.     DATA "Type in the pathname required (no more than 64 characters) or"
  1693.     DATA "Enter an empty string to quit."
  1694.  
  1695. KeyBuff:
  1696.     DATA 19, 6, 4, "Head Tail", 6, 33, "Keyboard Buffer"
  1697.     DATA  6, 67, "Buffer Area", 8, 4, "041A 041C"
  1698.     DATA  8, 17, "1E 20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C"
  1699.     DATA  8, 68, "0480 0482", 10, 3, "┌────┬────┐"
  1700.     DATA 10, 16, "┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐"
  1701.     DATA 10, 67, "┌────┬────┐",11, 3,"│         │", 11, 16, "│"
  1702.     DATA 11, 64, "│", 11, 67, "│         │", 12, 3, "└────┴────┘"
  1703.     DATA 12, 16, "└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘"
  1704.     DATA 12, 67, "└────┴────┘", 14, 3, "ASCII Codes"
  1705.     DATA 14, 67, "Waiting", 15, 3, "Scan Codes"
  1706.  
  1707. HWare:
  1708.     DATA "Unknown computer type", "PC", "PC/XT", "PCjr"
  1709.     DATA "PC/AT, PS/2 Model 50/60", "PC/XT", "PS/2 Model 30"
  1710.     DATA "PC Convertible", "PS/2 Model 80"
  1711.  
  1712. Shift:
  1713.     DATA "Left & Right SHIFT keys pressed", "CTRL key pressed"
  1714.     DATA "ALT key pressed", "SCROLL LOCK active"
  1715.     DATA "NUM LOCK active", "CAPS LOCK active"
  1716.     DATA "INSERT key status", "Left CTRL key pressed"
  1717.     DATA "Left ALT key pressed", "SYS REQ key pressed"
  1718.     DATA "PAUSE (or CTRL-NUM LOCK) active", "SCROLL LOCK pressed"
  1719.     DATA "NUM LOCK pressed", "CAPS LOCK pressed"
  1720.     DATA "INSERT key pressed"
  1721.  
  1722. Numbers:
  1723.     DATA 8, 1, 125678, 125678, 158, 158, 158, 158, 123458, 123458
  1724.     DATA 8, 4, 1278, 1278, 18, 148, 148, 148, F, 1235678
  1725.     DATA 8, 5, 12345, 12345, 5, 5, 45678, 45678, 5, 5
  1726.     DATA 8, 6, 12348, 12348, 148, 148, 148, 148, 145678, 145678
  1727.  
  1728. Crypt:
  1729.     DATA "This routine requires that you supply two strings of
  1730.     DATA "characters. The first is the text to be encrypted, and"
  1731.     DATA "the second is one or more keywords which are used to"
  1732.     DATA "encipher the text. Thereafter, the text cannot be"
  1733.     DATA "decrypted until you supply the same key string again."
  1734.  
  1735. Strings:
  1736.     DATA "Building a 1000 element, variable-length, string array"
  1737.     DATA "in memory and filling it with random data .... "
  1738.     DATA "Sort into Ascending or Descending order (A/D) [ ]"
  1739.  
  1740. Path:
  1741.     DATA "By default, the Toolbox Help system looks for its'"
  1742.     DATA "topic files in a subdirectory called HELP, beneath"
  1743.     DATA "the currently-logged directory.  You can, however,"
  1744.     DATA "direct it to look elsewhere for files by setting a"
  1745.     DATA "HELP variable in the DOS environment table;",""
  1746.     DATA "e.g.  SET HELP=C:\BASIC\TOOLBOX\HELP",""
  1747.     DATA "Alternatively, you can use the QuickBASIC ENVIRON"
  1748.     DATA "statement within your program, to point HELPMATE to"
  1749.     DATA "the appropriate pathname. Remember, 'though, that"
  1750.     DATA "this method only remains in effect as long as the"
  1751.     DATA "current program is running."
  1752.     DATA "The current HELP environment pathname is"
  1753.     DATA "Enter replacement or press <Esc> to leave unchanged"
  1754.  
  1755. Credits:
  1756.     DATA "   The Assembly-Language Toolbox for   "
  1757.     DATA "          Microsoft QuickBASIC         "
  1758.     DATA "    Professional Edition, Release 5    "
  1759.     DATA "                                       "
  1760.     DATA "is available for QuickBASIC 4.5 and the"
  1761.     DATA "BASIC 7 Professional Development System"
  1762.  
  1763.     DATA "The Professional Edition contains source code,"
  1764.     DATA "object files, stand-alone and Quick libraries"
  1765.     DATA "and a complete set of documentation. To order"
  1766.     DATA "your copy, send £25.00 plus postage to:", ""
  1767.     DATA "Christy Gemmell  22 Peake Road, Northfields"
  1768.     DATA "                 Leicester LE4 7DN"
  1769.     DATA "                 United Kingdom"
  1770.     DATA "            Tel. (044)-533-747960"
  1771.  
  1772. '┌────────────────────────────────────────────────────────────────────────┐
  1773. '│      (c) 1988,1991 By Christy Gemmell and Singular Software.           │
  1774. '└────────────────────────────────────────────────────────────────────────┘
  1775.